package com.chandra.pos.common.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Admin on 6/22/14.
 */

@Controller
public class LoginController {


    Logger logger = LoggerFactory.getLogger("chapters.introduction.HelloWorld2");


    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public String login(ModelMap model) {

        model.addAttribute("message", "Maven Web Project + Spring 3 MVC - welcome()");

        //Spring uses InternalResourceViewResolver and return back index.jsp
        return "login";

    }

    @RequestMapping(value = "/loginAction", method = RequestMethod.POST)
    public String loginAction(ModelMap model) {

        model.addAttribute("message", "Maven Web Project + Spring 3 MVC - welcome()");

        //Spring uses InternalResourceViewResolver and return back index.jsp
        return "index";

    }

    @RequestMapping(value = "/user/home", method = RequestMethod.GET)
    public String welcomeName(ModelMap model) {


        return "home";

    }
}
